--- title: Title keywords: fastai sidebar: home_sidebar nb_path: "nbs/01_HitTest.ipynb" ---
Then test it on a single day.
df = load_day_file(datetime(2016, 6, 30))
df.count()
df.head()
df.satellite.value_counts()
df = df.drop_duplicates()
df.shape
pd.DataFrame([df.dtypes, df.memory_usage(index=False, deep=True)], index=['Dtype', 'Mem']).T
df.info()
print(df.iloc[3]["line1"])
print(df.iloc[3]["line2"])
assert (datetime(1971, 6, 1) - datetime(1970, 6, 1)).days == 365
pd.DataFrame([51.5, 189, 2.3], index=['alt','az','days'])
Given at Lat/Lon/Time, what satellites can see me?
We pre-partition the TLE data by Year/Month/Day, so we can quickly load only today's TLE data, and check whether Lat/Lon can see it.
Here we apply the Skyfield.EarthSatellite function to all TLE rows in the dataframe for today.
Benchmark: this takes about 6s on a laptop. @TODO: speed this up by 10x.
Minor glitch: cannot use faster raw=True
In theory apply(..., raw=True) should be faster than default apply. However, it's not working due to:
AssertionError:Number of manager items must equal union of block items> # manager items:7, # tot_items:
- Possible solution:
https://www.nuomiphp.com/eplan/en/254300.html- On the other hand, it's an open pandas ticket:
https://github.com/pandas-dev/pandas/issues/34822
So I try the default way first. But the except won't work until we track down the block manager issue.
df_alt_az_days = satellite_alt_az_days(datetime(2016, 6, 30), 45.0, -176.0)
df_alt_az_days.count()
df_alt_az_days.head()
df_hit_quality = hit_quality(df_alt_az_days)
df_hit_quality["hit"].value_counts()
df_hit_quality["miss"].value_counts()
pd.concat([df_hit_quality["hit"].value_counts(), df_hit_quality["miss"].value_counts()], axis=1, sort=False)
df_alt_az_days_visible = df_alt_az_days[df_alt_az_days["altitude"]>0].copy()
df_alt_az_days_visible.count()
df_alt_az_days_visible.head(5)
Generate a polar alt/az plot of the qualifying satellites
TODO: Is "0" here 0 altitude? That would be on the horizon, which is counter-intuitive.
Note the band of satellites at southern bearings -- this ship was in the Northern hemisphere.
fig = viz(df_alt_az_days_visible)